import Vue from "vue";
import Router from "vue-router";
import home from "../views/home/home.vue";
import musicLibrary from "../views/home/children/musicLibrary.vue";
import personalAdvice from "../views/home/children/personalAdvice.vue";
import recommendSongs from "../views/list/recommendSongs.vue";
import songList from "../views/home/children/songList.vue";
import list from "../views/list/list.vue";
import listContent from "../views/list/listContent.vue";
import playList from "../views/list/playList.vue";
import music from "../views/music/music.vue";
import album from "../views/album/album.vue";
import albumList from "../views/album/albumList.vue";
import artist from "../views/artists/artist.vue";
import artistMsg from "../views/artists/children/artistMsg.vue";
import artistAlbum from "../views/artists/children/artistAlbum.vue";
import artistHotmusic from "../views/artists/children/artistHotmusic.vue";
import artistMV from "../views/artists/children/artistMV.vue";
import artistSimi from "../views/artists/children/artistSimi.vue";
import comment from "../views/comment/comment.vue";
import searchPage from "../views/search/searchPage.vue";
import searchResult from "../views/search/searchResult.vue";
import searchResultMusic from "../views/search/children/searchResultMusic.vue";
import searchResultAlbum from "../views/search/children/searchResultAlbum.vue";
import searchResultArtist from "../views/search/children/searchResultArtist.vue";
import searchResultMV from "../views/search/children/searchResultMV.vue";
import searchResultRadio from "../views/search/children/searchResultRadio.vue";
import searchResultSonglist from "../views/search/children/searchResultSonglist.vue";
import searchResultUser from "../views/search/children/searchResultUser.vue";
import mvhome from "../views/mv/mvhome.vue";
import mvLibrary from "../views/mv/mvList.vue";
import mvdetails from "../views/mv/children/MVdetails.vue";
import mvcomment from "../views/mv/children/mvComment.vue";
import similarMV from "../views/mv/children/similarMV.vue";
import hotMV from "../views/mv/children/hotMV.vue";
import newMV from "../views/mv/children/newMV.vue";
import mine from "../views/user/mine.vue";
import userHome from "../views/user/userHome.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "home",
      component: home,
      redirect: { name: "personalAdvice" },
      children: [
        {
          path: "musicLibrary",
          name: "library",
          component: musicLibrary,
          children: [
            {
              path: "",
              redirect: "personalAdvice",
            },
            {
              path: "personalAdvice",
              name: "personalAdvice",
              component: personalAdvice,
            },
            {
              path: "songList",
              name: "songList",
              component: songList,
            },
            {
              path: "list",
              name: "list",
              component: list,
            },
          ],
        },
      ],
    },
    {
      path: "/album/:id",
      name: "album",
      component: album,
      meta: { notKeepAlive: true },
    },
    {
      path: "/albumList",
      name: "albumList",
      component: albumList,
    },
    {
      path: "/artist/:id",
      name: "artist",
      component: artist,
      meta: { notKeepAlive: true },
      children: [
        {
          path: "",
          redirect: "artistHotmusic",
        },
        {
          path: "artistMsg",
          name: "artistMsg",
          component: artistMsg,
        },
        {
          path: "artistAlbum",
          name: "artistAlbum",
          component: artistAlbum,
        },
        {
          path: "artistHotmusic",
          name: "artistHotmusic",
          component: artistHotmusic,
        },
        {
          path: "artistMV",
          name: "artistMV",
          component: artistMV,
        },
        {
          path: "artistSimi",
          name: "artistSimi",
          component: artistSimi,
        },
      ],
    },
    {
      path: "/listContent/:id",
      name: "listContent",
      component: listContent,
      meta: { notKeepAlive: true },
    },
    {
      path: "/playList/:id",
      name: "playList",
      component: playList,
      meta: { notKeepAlive: true },
    },
    {
      path: "/user",
      name: "mine",
      component: mine,
    },
    {
      path: "/userHome/:id",
      name: "userHome",
      component: userHome,
    },
    {
      path: "/searchPage",
      name: "searchPage",
      component: searchPage,
    },
    {
      path: "/searchResult",
      name: "searchResult",
      component: searchResult,
      redirect: { name: "searchResultMusic" },
      meta: { notKeepAlive: true },
      children: [
        {
          path: "music",
          name: "searchResultMusic",
          component: searchResultMusic,
          meta: { notKeepAlive: true },
        },
        {
          path: "albums",
          name: "searchResultAlbum",
          component: searchResultAlbum,
          meta: { notKeepAlive: true },
        },
        {
          path: "artists",
          name: "searchResultArtist",
          component: searchResultArtist,
          meta: { notKeepAlive: true },
        },
        {
          path: "mvs",
          name: "searchResultMV",
          component: searchResultMV,
          meta: { notKeepAlive: true },
        },
        {
          path: "radio",
          name: "searchResultRadio",
          component: searchResultRadio,
          meta: { notKeepAlive: true },
        },
        {
          path: "songlist",
          name: "searchResultSonglist",
          component: searchResultSonglist,
          meta: { notKeepAlive: true },
        },
        {
          path: "users",
          name: "searchResultUser",
          component: searchResultUser,
          meta: { notKeepAlive: true },
        },
      ],
    },
    {
      path: "/music/:id",
      name: "music",
      component: music,
      meta: { notKeepAlive: true },
    },
    {
      path: "/comment/:id",
      name: "comment",
      component: comment,
      meta: { notKeepAlive: true },
    },
    {
      path: "/recommendSongs",
      name: "recommendSongs",
      component: recommendSongs,
    },
    {
      path: "/mv/:id",
      name: "mv",
      component: mvhome,
      redirect: { name: "details" },
      meta: { notKeepAlive: true },
      children: [
        {
          path: "details",
          name: "details",
          component: mvdetails,
          meta: { notKeepAlive: true },
        },
        {
          path: "mvcomment",
          name: "mvcomment",
          component: mvcomment,
          meta: { notKeepAlive: true },
        },
        {
          path: "similarMV",
          name: "similarMV",
          component: similarMV,
          meta: { notKeepAlive: true },
        },
      ],
    },
    {
      path: "/mvLibrary",
      name: "mvLibrary",
      component: mvLibrary,
      redirect: { path: "/mvLibrary/hotMv" },
      children: [
        {
          path: "hotMV",
          name: "hotMV",
          component: hotMV,
        },
        {
          path: "newMV",
          name: "newMV",
          component: newMV,
        },
      ],
    },
  ],
});
